<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="StateMgr,com.flashsim.FStEng.Three.StateMgr,contSt,cs,defSt,id,name,chgSt,passDown" name="keywords">
<title>com.flashsim.FStEng.Three.StateMgr</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'StateMgr - API Documentation';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">FlashSim State Engine, version 3.0</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?com/flashsim/FStEng/Three/StateMgr.html&amp;com/flashsim/FStEng/Three/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;StateMgr</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class StateMgr"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.flashsim.FStEng.Three</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class StateMgr</td>
</tr>
</table>
<p></p>
  Manages a network (collection) of states.   
  <p>The State (network) Manager class is used at run-time to manage which state(s) are active and
    which have been visited last (the history mechanism), in each network (collection of states).  All HState's must
    have only one State Manager, and all HStateC's must have one or more State Managers that you create.</p>
    <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#contSt">contSt</a> : <a href="../Three/HStateC.html">HStateC</a>
<div class="summaryTableDescription">
   Pointer to state containing this manager.</div>
</td><td class="summaryTableOwnerCol">StateMgr</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#cs">cs</a> : String<div class="summaryTableDescription">
   Identifier of the current state.</div>
</td><td class="summaryTableOwnerCol">StateMgr</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#defSt">defSt</a> : String<div class="summaryTableDescription">
   Identifier for the default start state.</div>
</td><td class="summaryTableOwnerCol">StateMgr</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#id">id</a> : String<div class="summaryTableDescription">
   <p>State Manager's identifier that must be different from other StateMgr's in sibling networks.</div>
</td><td class="summaryTableOwnerCol">StateMgr</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#name">name</a> : String<div class="summaryTableDescription">
   An optional name to give to the State Manager, used for display purposes only.</div>
</td><td class="summaryTableOwnerCol">StateMgr</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#StateMgr()">StateMgr</a>(identifier:String, defaultState:<a href="HStateC.html">HStateC</a>, containerState:String, n:* = null)</div>
<div class="summaryTableDescription">
  Constructor for State (network) Manager.</div>
</td><td class="summaryTableOwnerCol">StateMgr</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#chgSt()">chgSt</a>(trans:<a href="Transition.html">Transition</a>, val:*):void</div>
<div class="summaryTableDescription">
   Changes the current state (managed by this manager) based on the given transition ID.</div>
</td><td class="summaryTableOwnerCol">StateMgr</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#passDown()">passDown</a>(stPath:Array, hist:Boolean, sep:<a href="StateEngine.html">StateEngine</a>):void</div>
<div class="summaryTableDescription">
   Used by chgSt() and passUp() to make transitions that jump to levels
   within a sibling state but below the current level.</div>
</td><td class="summaryTableOwnerCol">StateMgr</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="contSt"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">contSt</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public var contSt:<a href="../Three/HStateC.html">HStateC</a></code><p>
   Pointer to state containing this manager.
   </p><p>Indicates which state encloses this network, in other words, which state is this manager working for.  Set to 'null' if this is manager at state engine (top) level.</p>
   </div>
<a name="cs"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">cs</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var cs:String</code><p>
   Identifier of the current state.
   </p><p>If this manager's network is active, this value is the current state's identifier.</p>
   </div>
<a name="defSt"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">defSt</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var defSt:String</code><p>
   Identifier for the default start state.
   </p><p>State machine developers indicate which state should be the default start state.  By convention, state identifiers are numeric,
   but we have implemented them as String's to give more flexibility.</p>
   </div>
<a name="id"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">id</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var id:String</code><p>
   </p><p>State Manager's identifier that must be different from other StateMgr's in sibling networks.  By convention,
   the identifier is alphabetic.  The identifier uniqueness only really becomes important in HStateC's, since that is
   the only state class with sibling networks.</p>
   </div>
<a name="name"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">name</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>name:String</code>&nbsp;&nbsp;[read-write]<p>
   An optional name to give to the State Manager, used for display purposes only. If no
   name is set, we use id by default.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get name():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set name(value:String):void</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="StateMgr()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">StateMgr</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function StateMgr(identifier:String, defaultState:<a href="HStateC.html">HStateC</a>, containerState:String, n:* = null)</code><p>
  Constructor for State (network) Manager.  One StateMgr is required to manage the
  network of each HState, or each sub-network of an HStateC.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">identifier</span>:String</code> &mdash;  String identifier (id) for the state manager.  Identifier must be unique only for sibling managers in an HStateC.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">defaultState</span>:<a href="HStateC.html">HStateC</a></code> &mdash;  Default start state (use the State's id).
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">containerState</span>:String</code> &mdash;  Pointer to state containing this manager.  'null' if this is manager at state engine (top) level. 
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">n</span>:*</code> (default = <code>null</code>)<code></code> &mdash;    State manager name (optional).  Used for display purposes only.  If no name passed in, routines use id.
  </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="chgSt()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">chgSt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function chgSt(trans:<a href="Transition.html">Transition</a>, val:*):void</code><p>
   Changes the current state (managed by this manager) based on the given transition ID.
   </p><p>In most circumstances, the engine handles triggering transitions based on injected events.  In some rare situations,
   developers may want to trigger a transition manually.  There is a method of State called <code>chgSt()</code>, which
   triggers the transition specified by the given transition identifier.  Similarly, the StateMgr chgSt() can be used
   to trigger a transition (identifier of the current state).</p>
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">trans</span>:<a href="Transition.html">Transition</a></code> &mdash; Transition ID to use for current state
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">val</span>:*</code> &mdash; an optional argument that is passed to the transition function
   </td>
</tr>
</table>
</div>
<a name="passDown()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">passDown</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function passDown(stPath:Array, hist:Boolean, sep:<a href="StateEngine.html">StateEngine</a>):void</code><p>
   Used by chgSt() and passUp() to make transitions that jump to levels
   within a sibling state but below the current level.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">stPath</span>:Array</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">hist</span>:Boolean</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">sep</span>:<a href="StateEngine.html">StateEngine</a></code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
